<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="/WEB-INF/template/template.xhtml">
	<ui:define name="content">
		<h:body>
			<h:form>


				<div class="middle">
					<h:messages class="myError" />
					<h:outputText value="&lt;br/&gt;" escape="false" />
					<h:panelGrid class="panelGridError"
						rendered="#{manageUserBean.usernameError !=null}">
						<h:outputText value="#{manageUserBean.usernameError}"
							style="color:#890120"></h:outputText>

					</h:panelGrid>
					<h:outputText value="&lt;br/&gt;" escape="false" />
					<h:panelGrid class="panelGridError"
						rendered="#{manageUserBean.emailError !=null}">
						<h:outputText value="#{manageUserBean.emailError}"
							style="color:#890120"></h:outputText>
					</h:panelGrid>

					<h3><h:outputText value="#{msg.OM_editbasicuser_editUser}"/></h3>
					<h:outputText value="&lt;br/&gt;" escape="false" />
					<br />

					<div class="middle">
						<h:outputText value="&lt;br/&gt;" escape="false" />
						<h:outputText value="#{manageUserBean.updateSuccessMessage}"
							id="updSuccMessage" styleClass="middle" style="color:#890120"></h:outputText>
						<h:outputText value="&lt;br/&gt;" escape="false" />
					</div>

				</div>
				<h:panelGrid border="0" columns="2" class="table">

					<h:outputText value="#{msg.OM_editbasicuser_name}"></h:outputText>
					<h:inputText value="#{manageUserBean.mname}" id="name"
						required="#{mpb.page eq 'editUser'}"
						requiredMessage="#{msg.OM_editmeasure_requiredMessage1}"
						validatorMessage="#{msg.OM_editmeasure_requiredMessage2}">
						<f:validateRegex pattern="^([A-Z]{1}[a-z]+[ ]?[-]?)+$"
							disabled="#{not mpb.page eq 'editUser'}"></f:validateRegex>
						<f:ajax render="updSuccMessage"></f:ajax>

					</h:inputText>



					<h:outputText value="#{msg.OM_editbasicuser_username}"></h:outputText>
					<h:inputText id="username" value="#{manageUserBean.username}"
						required="#{mpb.page eq 'editUser'}"
						requiredMessage="#{msg.OM_editmeasure_requiredMessage3}">
						<f:ajax event="valueChange">
							<f:validator validatorId="validators.UsernameValidator"
								disabled="#{not mpb.page eq 'editUser'}" />
						</f:ajax>
						<f:ajax render="updSuccMessage"></f:ajax>
					</h:inputText>



					<h:outputText value="#{msg.OM_editbasicuser_email}"></h:outputText>
					<h:inputText id="email" value="#{manageUserBean.email}"
						required="#{mpb.page eq 'editUser'}"
						requiredMessage="#{msg.OM_editmeasure_requiredMessage4}">
						<f:validator validatorId="validators.EmailValidator"
							disabled="#{not mpb.page eq 'editUser'}"></f:validator>
						<f:ajax render="updSuccMessage"></f:ajax>
					</h:inputText>
					<h:outputText value="#{msg.OM_editbasicuser_status}"></h:outputText>
					<h:selectOneMenu id="selectStatus" value="#{manageUserBean.active}">
						<f:selectItems value="#{manageUserBean.activeArray}"></f:selectItems>
					</h:selectOneMenu>
				</h:panelGrid>
				<div class="middle">
					<h:commandButton value="#{msg.OM_editbasicuser_back}" class="button"
						actionListener="#{manageUserBean.goBackToUsers}" immediate="true">
					</h:commandButton>
					<h:commandButton value="#{msg.OM_editbasicuser_resetPassword}" class="button"
						actionListener="#{manageUserBean.resetPasswordListener}"
						onclick="#{msg.OM_editmeasure_confirmationMessage3}">
					</h:commandButton>
					<h:commandButton value="Update User" class="button"
						actionListener="#{manageUserBean.updateUserListener}"
						onclick="#{msg.OM_editmeasure_confirmationMessage4}">
					</h:commandButton>

				</div>
			</h:form>

		</h:body>
	</ui:define>
</ui:composition>

</html>